package com.hspedu.homework.homework04;

/**
 * @Author Stringzhua
 * @Date 2024/3/3 16:49
 * description:经理类
 */
public class Manager extends Employee {
    //特有属性 奖金
    private double bonus;//奖金
    //重写父类的printSal方法
    @Override
    public void printSal() {
        //因为经理的工资计算方式和Employee不一样,所以在这里重写
        System.out.println("经理 " + getName() + "  工资是="
                + (bonus + getDaysal() * getWorkdays() * getGrade()));
    }

    //构造器
    //创建Manager对象时,奖金的多少不是确定的,因为在构造器中,不给bonus
    public Manager(String name, double daysal, int workdays, double grade) {
        super(name, daysal, workdays, grade);
    }

    //get/set方法
    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }
}
